home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / STK_STRT.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  742b  |  34 lines

  1. ;    DESC:    start a user stack                                   V1.00
  2. ;    SAMPLE:    STK_STRT
  3. ;    ##################################################################
  4.  
  5. STACK    Segment Para Common 'STACK'
  6.         DW    100H DUP(0)
  7. STACK    Ends
  8.  
  9. STK_STRC    Segment
  10.     Assume    CS:STK_STRC,SS:STACK
  11.     Public    STK_STRT
  12.                         ;notice.
  13.     DB    'STK_STRT - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  14.  
  15. STK_STRT    Proc    Near
  16.     Cli                    ;disable interrupts.
  17.  
  18.     Pop    CS:WORD PTR[0]            ;save return address.
  19.  
  20.     Mov    CS:WORD PTR[10],SS        ;save system stack offsets.
  21.     Mov    CS:WORD PTR[12],SP
  22.  
  23.     Mov    SP,STACK            ;setup user stack.
  24.     Mov    SS,SP
  25.     Mov    SP,100H
  26.  
  27.     Push    CS:WORD PTR[0]            ;replace return address.
  28.  
  29.     Sti                    ;enable interrupts.
  30.     Ret
  31. STK_STRT    Endp
  32. STK_STRC    Ends
  33.     End
  34.